﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true"
    CodeBehind="Login.aspx.cs" Inherits="VirtualOrg.Web.FormLoginUser" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        function Login() {
            if (jQuery('#form1').validationEngine('validate') == true) {
                loading.style.display = "";
                var username = document.getElementById('<%=txtUsername.ClientID %>').value;
                var password = document.getElementById('<%=txtPassword.ClientID %>').value;

                ob_post.AddParam("username", username);
                ob_post.AddParam("password", password);

                ob_post.post(null, "Login", LoginResponse);
            }

            return false;
        }

        function LoginResponse(result) {
            loading.style.display = "none";
            if (result != "") {
                msgboxpanel.innerHTML = result;
            }
            else {
                window.location.replace("Dashboard.aspx");
            }
        }

        $(function () {
            $("#accordion").accordion();
        });
    </script>
    <h2>
        Login here</h2>
    <hr />
    <div id="accordion" style="width: 100%;">
        <h3>
            <a href="#">Enter the username and password to login</a></h3>
        <div>
            <table style="width: 100%; height: 100px;">
                <tr>
                    <td>
                        <label for="author">
                            Username:</label>
                        <asp:TextBox ID="txtUsername" runat="server" CssClass="validate[required,minSize[6]] input_field ui-corner-all"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label>
                            Password:</label>
                        <asp:TextBox ID="txtPassword" TextMode="Password" runat="server" CssClass="validate[required,minSize[6]] input_field ui-corner-all"></asp:TextBox>
                    </td>
                </tr>
            </table>
            <div class="cleaner h10">
            </div>
            <asp:Button ID="btnLogin" OnClientClick="return Login();" runat="server" Text="Login" /><br />
            <br />
            <a href="../User/Create.aspx" class="link">Create new account</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="../User/Forgot.aspx" class="link">Forgot password?</a>
        </div>
    </div>
</asp:Content>
